package com.xinxin.o2o.service;

import com.xinxin.o2o.dto.ShopExecution;
import com.xinxin.o2o.exceptions.ShopOperationException;
import com.xinxin.o2o.model.Shop;
import org.springframework.stereotype.Service;

import java.io.File;
import java.io.InputStream;

/**
 * @author 史鑫鑫
 * @date 2019-08-13 23:07
 */
@Service
public interface ShopService {
    /**
     * 店铺注册
     *
     * @param shop     店铺信息
     * @param shopImg  店铺图片
     * @param fileName 图片名
     * @return 添加状态
     * @throws ShopOperationException 店铺操作异常
     */
    ShopExecution addShop(Shop shop, InputStream shopImg, String fileName) throws ShopOperationException;

    /**
     * 通过店铺获取店铺信息
     *
     * @param shopId 店铺id
     * @return 店铺信息
     */
    Shop getByShopId(Long shopId);

    /**
     * 修改店铺信息
     *
     * @param shop        店铺信息
     * @param inputStream 图片流
     * @return 修改后的状态
     * @throws ShopOperationException 抛出的异常
     */
    ShopExecution modifyShop(Shop shop, InputStream inputStream, String fileName) throws ShopOperationException;

    /**
     * 根据条件分页获取店铺列表
     *
     * @param shopCondition 查询条件
     * @param pageIndex     页码
     * @param pageSize      页面大小
     * @return 店铺列表
     */
    ShopExecution getShopList(Shop shopCondition, int pageIndex, int pageSize);
}
